package com.example.renshiguanli.mapper;

import com.example.renshiguanli.pojo.Emp;
import com.example.renshiguanli.pojo.Emprp;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface EmprpMapper {
//    查询所有
    List<Emprp> findAllEmprp();
//    添加信息
    @Insert(" insert into emprp (id, eid, rpDate, rpType, rpReason,rpPoint,remark)\n" +
            "        values (#{id}, #{eid}, #{rpDate},#{rpType}, #{rpReason},#{rpPoint},#{remark}\n" +
            "               )")
    void addEmprp(Emprp emprp);
//    根据id查询信息
    @Select("select * from emprp where id=#{id}")
    Emprp findById(Integer id);
//    修改信息
    @Update(" update emprp\n" +
            "        set eid=#{eid},\n"+"" +
            "           rpDate = #{rpDate},\n" +
            "            rpType = #{rpType},\n" +
            "            rpReason = #{rpReason},\n" +
            "            rpPoint = #{rpPoint},\n" +
            "            remark = #{remark}\n" +
            "        where id = #{id} ")
    void updateEmprp(Emprp emprp);
//    删除信息
    @Delete("delete from emprp where id=#{id}")
    void deleteEmprp(Integer id);
//    查找信息
    List<Emprp> query(String name);
}
